Fast quantum mechanical algorithms

ABSTRACT

A method for solving many classes of real-world problems with a quantum mechanical system by coaxing the system from a starting state to a desired state that is present in the quantum mechanical system with a probability greater than zero. Moving of the quantum mechanical system toward the desired states is effected by a repeated application of operator Q≡−I s U −1 I t U, U is a unitary matrix, I s  is a diagonal matrix that characterizes the starting state of the system with 1&#39;s in every position along the diagonal, except at the position corresponding to column s and row s, which represents the starting state, where it is −1. I t  is a similar diagonal matrix that characterizes the desired target state, t. The Q transformation is applied a prescribed number of times, followed by a single transfomation U, yielding the desired target state.

BACKGROUND

This invention relates to computing and, more particularly, to computingwith quantum computers.

Quantum computers were first considered in the 70's and early 80's. In1980, it was shown that a quantum computer could, in principle, computeanything that could be computed by a classical computer. Indeed, RichardFeynman discovered an example of a quantum mechanical system whichseemed very difficult to simulate on a classical computer, but which aquantum computer could easily do in polynomial time. Later, thedescription of quantum computers was formalized, and a number ofexamples were discovered in which a quantum computer could solve moreefficiently than a classical computer.

At the present time, there are still two major considerations relatingto quantum computers: how do you build a quantum computer, and whatkinds of algorithms could best utilize the inherent characteristics ofsuch a computer.

Quantum computer hardware is still in its infancy. The number of quantumcomputer designs that have been reported in the art is quite small. Onewidely discussed model is that of Cirac and Zoller (Phys. Rev. Lett. 74,4091, 1995) who showed how to use laser-cooled trapped ions as quantumlogic and memory devices. In an ion trap, individual atoms are suspendedby electromagnetic forces in an ultra-high vacuum, where they are almostcompletely de-coupled from their environment. The general principlesunderlying ion trap operations are found in U.S. Pat. Nos. 5,248,883 and5,379,000. Other physical systems have also been proposed for quantumlogic; for example, nuclear spins in solids. See U.S. Pat. No.5,530,263. A photon model has been tested in an experiment by Kimble etal and reported on in Phys. Rev. Lett. 75, 4710, 1995. U.S. Pat. No.5,793,091, issued Aug. 11, 1998, titled “Parallel Architecture forQuantum Computers Using Box Trap Arrays” describes a quantum computerarchitecture that uses many small quantum channels for frequentlyperformed logic and memory operations, and a few large channels forinfrequently performed operations.

More recently, in an article titled “Experimental Implementation of fastquantum searching” Isaac Chuang et al reported in Phys. Rev. Lett. Vol.80, No. 15, April 1998, on a quantum computer implementation thatemploys the spins of carbon and hydrogen nuclei in chloroform. This is asignificant achievement because, as indicated above, not only isbuilding a quantum computer a challenging task, but employing such acomputer effectively to solve a useful problem is equally challenging.The Chuang et al article should go a long way to convince designers ofthe quantum computer's ultimate usefulness.

The realm of algorithms that are particularly well suited for quantumcomputers has not been without advances either. In 1994, Peter Shorpresented an efficient quantum mechanical algorithm for factorization,that is exponentially faster than any known classical algorithm,Factorization is an important problem because numerous encryptionsystems rely on the fact that classical computers require a very longtime to factor large numbers.

In Jul. of 1997, I published an article titled “Quantum Mechanics Helpsin Searching for Needle in a Haystack,” in Phys. Rev. Letrs., Vol. 79,No. 2, pp. 325-328, describing an algorithm that is polynomially fasterthan any classical algorithm. This algorithm finds a desired object inan unsorted database in ο({square root over (N)}) steps, as compared toο(N) for the classical search. Other quantum mechanical algorithms forimportant computer science problems have also been discovered, but thereis still no general technique for obtaining efficient quantumalgorithms.

SUMMARY

This disclosure presents a general quantum mechanical algorithm andsystem architecture that efficiently solve many classes of real-worldproblems. Specifically, it demonstrates that quantum mechanical problemsare solved efficiently when any unitary matrix U is employed, and atransformation Q is applied, where Q≡−I_(s)U⁻¹I_(t)U. I_(s) is adiagonal matrix that characterizes the starting state of the system with1's in every position along the diagonal, except at the positioncorresponding to column s and row s, which represents the startingstate, where it is −1. I_(t) is a similar diagonal matrix thatcharacterizes the desired target state, t. The Q transformation isapplied a prescribed number of times, followed by a singletransformation U, yielding the desired target state.

BRIEF DESCRIPTION OF THE DRAWING

FIG. 1 depicts an arrangement for processing the information in a singlequantum bit (information is stored classically and is processed withclassical hardware);

FIG. 2 shows an arrangement for selective inversion of that informationin a qubit in a vector of qubits (which was stored classically); and

FIG. 3 illustrates an arrangement for applying operator Q a selectednumber of times, followed by application of operator U, which coaxes aquantum mechanical system from a starting state to a desired targetstate(as in FIG. 1, information is stored classically and is processedwith classical hardware).

DETAILED DESCRIPTION Overview

Just like classical probabilistic algorithms, quantum mechanicalalgorithms work with a probability distribution over various states.However, unlike classical systems, the probability vector does notcompletely describe a quantum system. According to quantum mechanics,the true nature of all objects is wavelike and the complete descriptionof a quantum system requires the specification of both the magnitude aswell as the phase of this probability. A quantum mechanical system isusually described by specifying a complex number called the amplitudefor each state - this description is called a superposition. Theamplitude, being a complex number, has both a magnitude and a phase. Themagnitude squared of the amplitude of each state specifies theprobability of the system being in that state.

In classical probabilistic systems, the evolution of a system is givenby premultiplying the probability vector by a Markov transition matrix.This matrix has constraints that the sum of each column be unity and allthe elements be non-negative. These constraints arise from the fact thatprobability must be conserved. In a quantum mechanical system the statetransition matrix acts on the amplitude vector and the conservation ofprobability leads to the constraint that the state transition matrix beunitary, i.e. the columns of the matrix be orthogonal to each other.

A complex quantum mechanical system is usually designed out ofelementary two-state quantum systems. Each two-state quantum system iscalled a quantum bit, or a qubit. Quantum mechanical operations that canbe carried out in a controlled way are unitary operations that act on asmall number of qubits in each step.

A basic operation heretofore employed in quantum computing is theWalsh-Hadamard transformation performed on a single qubit. This isrepresented by the unitary matrix $\begin{matrix}{M \equiv {{\frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\1 & {- 1}\end{bmatrix}}.}} & (1)\end{matrix}$

A qubit that is at state “1” can be written as the vector [0|0>, 1|1>],and applying the matrix (1) to the superposition yields${{\frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\1 & {- 1}\end{bmatrix}}\begin{bmatrix}0 \\1\end{bmatrix}},$

or the superposition$\left( {\frac{1}{\sqrt{2}},{- \frac{1}{\sqrt{2}}}} \right).$

Similarly, a qubit that is at state “0” can be written as [1|0>,0|1>],and applying the matrix (1) to the superposition yields${{\frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\1 & {- 1}\end{bmatrix}}\begin{bmatrix}1 \\0\end{bmatrix}},$

or the superposition$\left( {\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}} \right).$

A quantum computer may be designed with words having n qubits and eachword having N=2″ basis states. In this disclosure, “state” or “state ofthe system” means one of the N basis states in which each of the nqubits is either a 0 or a 1. Just as with classical computing, words ina quantum computer can be processed serially or in parallel. Whenperforming operations serially, the state transition matrix of equation(1) above can be employed. When performing operations in parallel, acorresponding transformation may be made with a matrix of dimension2″×2″ with values $\frac{\pm 1}{\sqrt{N}}$

in all positions, having columns that are orthogonal to each other (asis the case for all unitary matrices).

Illustratively, the M transformation can be implemented for a single bit(i.e., for a serial arithmetic computer) with classical hardware in themanner described in FIG. 1. A qubit is defined by four registers 11, 12,13, and 14. These registers store the real and imaginary values of theamplitudes of the 0 and the 1 of the qubit. They can also be arranged tostore the magnitude and phase of the 0 and the 1 of the qubit. Processor20 performs the Hadamard transformation by summing the contents ofregisters 11 and 13 and placing the sum in register 31, summing thecontents of registers 12 and 14 and placing the sum in register 32,subtracting the contents of register 13 from the contents of register11, and subtracting the contents of register 14 from the contents ofregister.

Consider a case when the starting state is one of the 2″ basis states,i.e. a state described by a general string of n binary digits composedof some 0s and some 1s. The result of performing the transformation M oneach qubit will be a superposition of states consisting of all possiblen bit binary strings with amplitude of each state being±2^({fraction (n/2)}). This transformation is referred to as the W-Htransformation and denoted in the literature by W. See D. Deutsch and R.Jozsa, Rapid solution of problems by quantum compultation, Proc. RoyalSociety of London, A400, 1992, pp. 73-90.

In my aforementioned July 1997 article, I presented an algorithm forperforming a database search. The search problem can be expressed asfollows. Let a system have N=2″ states, which are labeled S₁, S₂, . . .S_(N). Some unique state S_(ν) satisfies the condition C(S_(ν))=1, whichrepresents a match condition, or a “hit”. For all other states j≠νv,C(S_(j))=0, which represents a no match condition, or a “miss”. Thealgorithm first initializes the system to the superposition (1/{squareroot over (N,)}1/{square root over (N,)}. . . 1/{square root over (N)}),in which all states are equally probable. Operating in serialarithmetic, this state can be achieved by applying W to each qubit of aninput word in a serial fashion, where the starting states of theincoming qubits are all “0”. A sequence of alternating operations isperformed comprising a selective inversion followed by a diffusiontransformation D. D is a transformation described by an N×N matrix wherethe diagonal terms are −1+{fraction (2+L /N )} and all other terms are{fraction (2+L /N)}. After this sequence of operatios, the resultingstate is measured. The result will be the state S_(ν) with a probabilityof at least 0.5.

Selective inversion of the phase of the amplitude in certain states is aparticular case of selective rotation performed by the rotation matrix(2). It can be effected, for example, with a circuit 100 as shown inFIG. 2 where the input is the information in the quantum which is storedclassically. This corresponds to the input applied at input 101 togetherwith the ancilla input bit applied at input 102. The input at line 101may be a word x, corresponding to n qubits x₁, x₂, . . . x_(n) with2^(n) states and describable by a collection of terms in the forma_(k)|c₁c₂. . . c_(n)>, where the c's are either 0 or 1, and the ancillabit, b, at input 102 is in the superposition$\frac{1}{\sqrt{2}}{\left( {{{{{0 >}, -}}1} >} \right).}$

Block 110 is responsive to word x, applying a selected function ƒ(x), asprovided by lead 105. Presumably ƒ(x)=1 for at least some state of theword x, and when such is the case, circuit 101 reverses the amplitude ofthe ancilla bit of that state. For example, an input word x where n=2can be described by the superposition (a₁|00>, a₂|01>, a₃|10>, a₄|11>).Viewing the FIG. 2 circuit with the ancilla bit (in the leastsignificant bit position), the input can be described by $\begin{matrix}{{{\left( {{{a_{1}{{{00 >},a_{2}}}01} >},{{a_{3}{{{10 >},a_{4}}}11} >}} \right)\frac{1}{\sqrt{2}}\left( {{{{{0 >}, -}}1} >} \right)},{or}}{\frac{1}{\sqrt{2}}\left( {{{a_{1}{{{000 >},a_{2}}}010} >},{{a_{3}{{{100 >},a_{4}}}110} > \begin{matrix}{\left. {{{{- a_{1}}{{{001 >},{- a_{2}}}}011} >},{{{- a_{3}}{{{101 >},{- a_{4}}}}111} >}} \right).}\end{matrix}}} \right.}} & (2)\end{matrix}$

As stated above, the operation of circuit 110 is to reverse the ancillabit when ƒ(x)=1. If, for example, ƒ(x)=1 when x is at state |10>, thenthe ancilla bit in the third and seventh term is reversed, yielding$\frac{1}{\sqrt{2}}\left( {{{a_{1}{{{000 >},a_{2}}}010} >},{{a_{3}{{{101 >},a_{4}}}110} > {{- a_{1}}{{{001 >},{- a_{2}}}}011} >},{{{- a_{3}}{{{100 >},{- a_{4}}}}111} >}} \right)$

Reversing the positions of the third and seventh terms, the above can bewritten as $\begin{matrix}{{\frac{1}{\sqrt{2}}\left( {{{a_{1}{{{000 >},a_{2}}}010} >},{{{- a_{3}}{{{100 >},a_{4}}}110} >},{{{- a_{1}}{{{001 >},{- a_{2}}}}011} >},{{a_{3}{{{100 >},{- a_{4}}}}111} >}} \right)}{{or}\quad \left( {{{a_{1}{{{00 >},a_{2}}}01} >},{{{- a_{3}}{{{10 >},a_{4}}}11} >}} \right)\frac{1}{\sqrt{2}}{\left( {{{{{0 >}, -}}1} >} \right).}}} & (3)\end{matrix}$

When the least significant qubit is ignored, what is left is (a₁|00>,a₂|01>, −a₃|10>, a₄|11>). Note the reversal of amplitude of the |10>state, which was the intended result.

C. H. Bennett in “Space-Time Trade-Off in Reversible Computing,” SIAMJournal of Computing, vol. 18, pp. 766-776, 1989 proved that it ispossible to design a quantum mechanical circuit to evaluate any functionƒ(x) that can be evaluated classically with comparable hardware. Sincethe following employs the selective reversal circuit on the vector of2^(n) states, the FIG. 2 embodiment might best be implemented byconverting words of n qubits into vectors of 2^(n) states, and dealingwith the α_(k) coefficients as outlined above.

Amplitude Amplification

Let each point of the domain of ƒ(x) be mapped to a state t, which isthe target state. It is assumed that the function ƒ(x) is non-zero atthe point corresponding to state t. The object is to get the system intothe t-state. Assume that we have at out disposal a transformation U thatis unitary and we start with the system in some state s. If we apply Uto s, the amplitude of state t is U_(ts), which means that |U_(ts)|², isthe probability of a system at state s would, upon application ofoperator U, reach state t. Viewing this as a classical situation wherethe probability of success (reaching state t) is |U_(ts)|², one wouldconclude that the expected number of repetitions before a single successis proportional to 1/|U_(ts)|².

The following discloses a process whereby it is possible to reach statet in only ο(1/|U_(ts)|)steps. This leads to a sizable improvement in thenumber of steps if |U_(ts)|<<1.

Denote the unitary operation that inverts the amplitude in a singlestate x by I_(x). In matrix notation, this is the diagonal matrix withall diagonal terms equal to 1, except the term along the diagonal incolumn (and row) x, which is equal to −1. That is, in a system wherewords are n qubits long, and each word can be in a superposition of2^(n) states, the matrix I_(x) is a 2^(n)×2 ^(n) diagonal matrix with1's in every position along the diagonal, except at position xx, whereit is −1. Let ν_(x) denote a column vector which has all terms zero,except for the x^(th) term which is unity; and consider the followingunitary operator

Q≡−I_(s)U⁻¹I,U.  (4)

As an aside, the notations used herein, in conformance with the notionsused in most quantum mechanics texts, AB denotes a sequence of operationB followed by operation A. Thus, −I_(s)U⁻¹I_(t)U denotes first U, thenI_(t), then U⁻¹, and lastly −I_(s). It may be noted that since U isunitary, U⁻¹ is equal to its adjoint, i.e. its conjugate transpose.

The following shows that the operator Q preserves the twodimensional_vector space spanned by ν_(s) and (U⁻¹ν_(t)).

First, consider the action of Q on the vector ν_(s): By the definitionof Q, this equals −I_(s)U⁻¹I_(t)Uν_(s). Since ν_(x)ν_(x) ^(t) is an N×Nsquare matrix of all whose terms are zero, except the xx term which is1, it follows that I_(t)≡I−2ν_(t)ν_(t) ^(T), and I_(s)≡I−2ν_(s)ν_(s)^(T), yielding $\begin{matrix}\begin{matrix}{{Qv}_{s} = {{- \left( {I - {2v_{s}v_{s}^{T}}} \right)}{U^{- 1}\left( {I - {2v_{t}v_{t}^{T}}} \right)}{Uv}_{s}}} \\{= {{{- \left( {I - {2v_{s}v_{s}^{T}}} \right)}U^{- 1}{Uv}_{s}} + {2\left( {I - {2v_{s}v_{s}^{T}}} \right){U^{- 1}\left( {v_{t}v_{t}^{T}} \right)}{Uv}_{s}}}}\end{matrix} & (5)\end{matrix}$

Using the fact that: ν_(x) ^(T)ν_(s)≡1 it follows that

Qν_(s)≡ν_(s)+2(I−2ν_(s)ν_(s) ^(T))U⁻¹(ν_(t)ν_(t) ^(T))Uν_(s).  (6)

Simplifying the second term of (6) by the following identity: ν_(t)^(T)Uν_(s)≡U_(ts) and the consequent identity ν_(s) ^(t)U⁻¹ν_(t)≡U_(ts)^(*), which follows from the fact that U is unitary and so its inverseis equal to its adjoint, yields

Qν_(s)=ν_(s)(1−4|U_(ts)|²)+2U_(st)(U⁻ν_(t)).  (7)

Next, consider the action of the operator Q on the vector U⁻¹ν_(t):Using the definition of Q and carrying out the algebra yields:$\begin{matrix}\begin{matrix}{{Q\left( {U^{- 1}v_{t}} \right)} \equiv \quad {{- I_{s}}U^{- 1}I_{t}{U\left( {U^{- 1}v_{t}} \right)}}} \\{= \quad {{{- I_{s}}U^{- 1}I_{t}v_{t}} = {I_{s}U^{- 1}v_{t}}}}\end{matrix} & (8)\end{matrix}$

Writing I_(s) as 1−2ν_(s)ν_(s) ^(t) and ν_(s) ^(T)U⁻¹ν_(t)≡U_(ts) ^(*)yields $\begin{matrix}\begin{matrix}{{Q\left( {U^{- 1}v_{t}} \right)} = {\left( {U^{- 1}v_{t}} \right) - {2v_{s}{v_{s}^{T}\left( {U^{- 1}v_{t}} \right)}}}} \\{= {\left( {U^{- 1}v_{t}} \right) - {2U_{ts}^{*}{v_{s}.}}}}\end{matrix} & (9)\end{matrix}$

Equations (7) and (9) may be written as: $\begin{matrix}{{{Q\begin{bmatrix}v_{s} \\{U^{- 1}v_{t}}\end{bmatrix}} = {\begin{bmatrix}\left( {1 - {4{U_{ts}}^{2}}} \right) & {2U_{ts}} \\{{- 2}U_{ts}^{*}} & 1\end{bmatrix}\begin{bmatrix}v_{s} \\{U^{- 1}v_{t}}\end{bmatrix}}},} & (10)\end{matrix}$

from which it can be seen that the operator Q transforms anysuperposition of the vectors ν_(s) and U⁻¹ν_(t) into anothersuperposition of the two vectors, thus preserving the two dimensionalvector space spanned by the vectors ν_(s) and U⁻¹ν_(t).

Effectively, the Q operator rotates each vector in the space (ν_(s)being the abscissa and U⁻¹ν_(t) being the ordinate) by approximately2|U_(ts)| radians. Since ν_(s) and U⁻¹ν_(t) are almost orthogonal, inapproximately $\frac{\pi}{4{U_{ts}}}$

applications, it transforms ν_(s) into U⁻¹ν_(t). Viewed another way,when applying operator Q some number times, η, to equation (6), theresult of Q₁Q₃ . . . Q_(η)ν_(s) can be expressed byα_(s)ν_(s)+α_(t)U⁻¹ν_(t), and it can be shown that α_(s)=cos(2η|U_(ts)|)and |α_(t)|=|sin(2η|U_(ts)|)|.

Hence, if${\eta = \frac{\pi \left( {1 + {2k}} \right)}{4{U_{ts}}}},$

where k is an integer we get the superposition U⁻¹ν_(t), from this witha single application of U we can get ν_(t). Of course, the smallestvalue of $\eta \quad {is}\quad {\frac{\pi}{4{U_{ts}}}.}$

For example, if |U_(ts)|=0.000123, the smallest value of${\eta \quad {is}\quad \frac{\pi}{4 \times 0.000123}},$

which is approximately 6385.3. Performing the iteration 6385 timesyields |α_(t)|=|sin (2×6385×0.000123)|{tilde over (=)}1.Correspondingly, α_(s){tilde over (=)}0.

The above demonstrates that in $O\left( \frac{1}{U_{ts}} \right)$

steps, we can start with the s-state and reach the target state t withcertainty.

One embodiment that conforms to the above teachings is presented in FIG.3. This embodiment of the algorithm can be implemented with classicalcircuitry, but it should be understood that the algorithm can also beimplemented with systems that truly operate with quantum states, such asdemonstrated in the aforementioned Chuang et al article. In FIG. 3,element 201 is the information store upon which the operations areperformed. In classical computing terms, it may be the database whichcontains data about which some information is to be extracted. Inquantum computing terms, it may be an element that is in a superpositionof quantum states (or, effectively, stores a plurality of quantumstates). The information to be derived about the data stored in element201 can vary, of course. A user of the FIG. 3 system may be interestedin whether a particular piece of data is found in element 201, a usermay be interested in the median of the data in element 201, etc.

The information contained in element 201 is made available to transformelement 202, which applies thereto the transform U. The output ofelement 202 is applied to transform element 203, which performs thetransformation I_(t). It is noted that this element receives thecriteria that are supplied to the FIG. 3 system to induce it to reach acertain state. In the case of a search algorithm, this will be thesearch criteria.

The output of element 203 is applied to transform element 204 whichperforms the transformation U⁻¹, and the output of element 204 isapplied to transform element 205 which performs the transformationI_(s). The output of element 205 is fed back to element 201 for storage,basically modifying the contents of element 201, and the process repeatsa number of times, on the order of $\left( \frac{1}{U_{ts}} \right).$

Following the prescribed number of repetitions, the output of element205 corresponds to U⁻¹ν_(t), and is applied to transformation element206 which applies the transformation U and, thereby, obtains the desiredresult. This result can be utilized immediately, or it can be re-enteredinto element 201.

The above derivation easily extends to the case when the amplitudes instates, s and t, instead of being inverted by I_(s) and I_(t), arerotated by an arbitrary phase. However, the number of operationsrequired to reach t will be greater. Given a choice, it would be clearlybetter to use the inversion rather than a different phase rotation. Alsothe analysis can be extended to include the case where I_(t) is replacedby Y_(t)=V⁻¹I_(t)V, where V is an arbitrary unitary matrix. The analysisis the same as before but instead of the operation U, we will now havethe operation Z=VU. This is the same as replacing U by X=VU.

An interesting feature of the above analysis is that U can be anyunitary transformation. Also, the states s and t can be any two basisstates. Clearly, these facts can be used to design algorithms where U isa transformation in a quantum computer.

The following presents a number of illustrative realizations thataddress particular, important, real-world problems. The first three aresearch-type applications, the next two are statistical applications.Additional applications are presented in L. K. Grover, Quantum search onstructured problems, presented at the 1^(st) NASA Conference on quantumcomputation and quantum communication, Palm Springs, Calif., February1998.

The general approach that is used in each of the algorithms is to reducethe problem to one of getting the system into a state t. A unitarytransform U and the initial state s are selected, and U_(ts) iscalculated. By the above analysis, it follows that if we start withinitial state s and carry out $O\left( \frac{1}{U_{ts}} \right)$

repetitions of the operation sequence −I_(s)U⁻¹I_(t)U, followed by asingle application of U, there is an appreciable amplitude of the systemreaching the t-state.

(i) Exhaustive search starting from the {overscore (0)} state

The N=2^(n) states to be searched are represented by n qubits. In casethe starting states s is the {overscore (0)} state and the unitarytransformation U is chosen to be W, then U_(ts) for any target state$t\quad {is}\quad {\frac{1}{\sqrt{N}}.}$

For a system with N states, W is a 2^(n)×2^(n) matrix with values$\frac{\pm 1}{\sqrt{N}}$

in all positions, and the columns are orthogonal to each other (as isthe case for all unitary matrices).

As indicated above, the process stars with {overscore (0)} state andcarries out repeated operations of Q≡−I_(s)U⁻¹I_(t)U. That is, thesystem starts with an input, applies the unitary transformation U in acircuit akin to the circuit depicted in FIG. 1, and applies the resultto a circuit that performs the transformation I_(t). This is a circuitas depicted in FIG. 2, where the searching criteria are places such thata state that corresponds to the desired state causes ƒ(x) to equal 1.The output of this transformation is again applied to a circuit akin tothe circuit of FIG. 2 to perform the U⁻¹ transformation, and the outputof that transformation is applied to a circuit that performs thetransformation I_(s). In this case, $\begin{matrix}{I_{s} = {I_{\overset{\_}{0}} = {\begin{bmatrix}{- 1} & 0 & \cdots & 0 \\0 & 1 & \cdots & 0 \\\vdots & \vdots & ⋰ & \vdots \\0 & 0 & \cdots & 1\end{bmatrix}.}}} & (11)\end{matrix}$

With U⁻¹=U=W and s as the {overscore (0)} state, Q becomesQ≡−I_({overscore (0)})WI_(t)W. Hence, the operation sequence is

(−I_({overscore (0)})WI_(t)W)(−I_({overscore (0)})WI_(t)W)(−I_({overscore (0)})WI_(t)W)  (12)

By rearranging parentheses and shifting minus signs, one can obtain

(−I_({overscore (0)})WI_(t))[−(WI_({overscore (0)})W)(I_(t))][−(WI_({overscore (0)})WI_(t)W)]  (13)

which includes repetitions of (−WI_({overscore (0)})W)(I_(t)).

The operation sequence −WI_({overscore (0)})W is simply the inversionabout average operation, as demonstrated by my aforementioned July 1997publication. To see this, note that I_({overscore (0)}) equals$I - {2v_{\overset{\_}{0}}v_{\overset{\_}{0}}^{T}}$

and, therefore, for any vector {overscore (x)}, $\begin{matrix}{{{- {WI}_{\overset{\_}{0}}}W\overset{\_}{x}} = {{{- {W\left( {I - {2v_{\overset{\_}{0}}v_{\overset{\_}{0}}^{T}}} \right)}}W\overset{\_}{x}} = {{- \overset{\_}{x}} + {2{Wv}_{\overset{\_}{0}}v_{\overset{\_}{0}}^{T}W{\overset{\_}{x}.}}}}} & (14)\end{matrix}$

It is easily seen that Wν_({overscore (0)})ν_({overscore (0)})^(T)W{overscore (x)} is another vector, each of whose components is thesame and equal to A, where$A \equiv {\frac{1}{N}{\sum\limits_{i = 1}^{N}x_{i}}}$

(the average value of all components). Therefore, the i^(th) componentof −WI_({overscore (0)})W{overscore (x)} is simply (−x_(i)+2A). This maybe written as A+(A−x_(i)), i.e. each component is as much above (below)the average as it was initially below (above) the average, which isprecisely the inversion about average.

(ii) Exhaustive search starting from an arbitrary basis state

In the case where U is chosen as the W-H transform W, the matrix elementU_(ts) between any pair of states s and${t\quad {is}} \pm {\frac{1}{\sqrt{N}}.}$

Therefore, the search algorithm can start with any of the N=2^(n) basisstates as the initial state s, and the procedure disclosed above yieldsan algorithm to reach state t in${O\left( \frac{1}{U_{ts}} \right)},$

i.e. ο({square root over (N)}), iterations. Therefore, instead ofstarting with {overscore (0)} state, as in (i), we could equally wellstart with any basis state s, and repeatedly apply the operationsequence Q=−I_(s)WI_(t)W to obtain an equally efficient ο({square rootover (N)}) algorithm.

The dynamics is similar to (i); only there is no longer the convenientinversion about average interpretation.

(iii) Search when an item near the desired state is known

When an n bit word is specified and the desired word differs from thespecified word in exactly k bits, the effect of this constraint is toreduce the size of the solution space. One way of making use of thisconstraint, would be to map this to another problem which exhaustivelysearched the reduced space using (i) or (ii). However, such a mappingwould involve additional overhead. This section present a differentapproach which also carries over to more complicated situations.

Instead of choosing U as the Walsh-Hadamard transform, as is the choicein (i) and (ii), U is tailored to the problem under consideration. Thestarting state s is chosen to be the specified word, and the operation Uconsists of the transformation $\begin{matrix}{\begin{bmatrix}\sqrt{1 - \frac{1}{\alpha}} & \frac{1}{\sqrt{\alpha}} \\\frac{1}{\sqrt{\alpha}} & {- \sqrt{1 - \frac{1}{\alpha}}}\end{bmatrix},} & (15)\end{matrix}$

applied to each of the n qubits (α is a variable parameter yet to bedetermined). Note that if α is 2, we obtain the W-H transform.Calculating U_(ts), it follows that${U_{ts}} = {\left( {1 - \frac{1}{\alpha}} \right)^{\frac{n - k}{2}}\left( \frac{1}{\alpha} \right)^{\frac{k}{2}}}$

(equal in n-k bits and differs in k bits). This is maximized when α ischosen as {fraction (n/k)}, and then${\log {U_{ts}}} = {{\frac{n}{2}\log \frac{n - k}{n}} - {\frac{k}{2}\log {\frac{n - k}{k}.}}}$

Now, repeating $O\left( \frac{1}{U_{ts}} \right)$

times the sequence of operations −I_(s)U⁻¹I_(t)U, followed by a singleapplication of U yields the desired result.

The size of the space being searched in this problem is ^(n)C_(k) whichis equal to $\frac{n!}{n - {{k!}{k!}}}.$

Using Stirling's approximation of log n!≈nlogn−n, it follows that${\log {{}_{}^{}{}_{}^{}}} \approx {{n\quad \log \quad \frac{n}{n - k}} - {k\quad \log \quad {\frac{k}{n - k}.}}}$

Comparing this to the number of steps required by the algorithm, we findthat the number of steps in this algorithm, as in (i) and (ii), variesapproximately as the square-root of the size of the solution space beingsearched.

(iv) Estimating the median to a precision ε

Problem: Assume that we are given N=2^(n) values between 0 and 1 denotedby x₀, x₁. . . x_(N−1) and a certain threshold θ. Let Γ denote thefractional difference in the number of values above and below θ, i.e.the number of values below θ is N(1−ε)/2. Given the bound |ε|<2ε₀, thetask is to find an estimate ε_(e) such that ∥ε_(e)|−|ε∥<ε₀/4.

If we can solve the above problem in ο(1/ε₀) steps, then it is possibleto iterate with different thresholds and estimate the median to aprecision ε in ο(1/ε₀) steps.

Classically one needs Ω(1/ε²)steps to estimate the median with aprecision of ε. (All bounds in this and the next example are up topolylogarithmic factors).

Solution: The basic idea is to devise a unitary operation U due to whichthe amplitude in a t-state comes out to be proportional to the statisticto be estimated. By repeating the operation −I_(s)U⁻¹I_(t)U, andappropriate number of times, the probability in the t-state is boostedto the point that it can be estimated by carrying out the experiment afew times.

Consider an N=2^(n) state quantum system represented by n qubits, andassociate a value x_(α) with each state, S_(α). Next consider theunitary transform R that is a selective inversion operation such thatwhen the value x_(α) associated with the state S_(α) is smaller than thethreshold θ, the amplitude in S_(α) is inverted.

Start the system in the {overscore (0)} state and consider the unitaryoperation U=WRW. It is easily seen that after U. the amplitude of thesystem being in the {overscore (0)} state is ε. Also, note thatU⁻¹=W⁻¹R⁻¹W⁻¹=WRW. Therefore, it follows that after ο(1/ε₀) repetitionsof Q≡−I_({overscore (0)})U⁻¹I_({overscore (0)})U, followed by a singleapplication of U, the amplitude in the {overscore (0)} state reachesε/4ε₀. Now, if a measurement is made with projects the system onto oneof its basis states, the probability of getting {overscore (0)} is(ε/4ε₀)². It follows from the central limit theorem that by repeatingthis experiment ο(M) times, it is possible to estimate$\frac{ɛ}{ɛ_{0}}$

with a precision of $\frac{1}{\sqrt{M}},$

and hence |ε| with a precision $\frac{ɛ_{0}}{\sqrt{M}}.$

By appropriately choosing M, it is possible to estimate |ε| within anerror bound of ε₀/4.

(v) Estimating the mean to a precision ε

Problem: Assume that we are given N=2^(n) values denoted by x₀,x₁, . . .x_(N−1), each x_(α) lies in the range (−0.5, 0.5). The task is toestimate the mean (denoted by μ) to a specified precision ε.

Classically this would take Ω(1/ε²)steps. The best known quantummechanical algorithm takes ο(1/ε^(1.5)) steps. Employing the principlesof this invention, however, a simple ο(1/ε) step quantum mechanicalalgorithm (up to polylogarithmic factors) will yield the desired result.

Solution: Start with a relatively large ε₀ which is chosen so that|μ|<ε₀. Carry out the following loop (i) . . . (iii):

(i) Estimate μ with a precision of ε₀, i.e. find an estimate μ_(e) suchthat |μ_(e)−μ|<ε₀/2. This step is described in the “Main algorithm”below.

(ii) Shift each of the numbers by the newly estimated mean, i.e.x_(α)=x_(α)−μ_(e).

(iii) If ε₀>ε, replace ε₀ by ε₀/2 and go to (i). Otherwise, stop.

The mean may be estimated as the sum of the estimated μ_(e) in eachiteration of step (i) of the loop.

Main algorithm: The heart of the above algorithm is step (i) of theabove loop, i.e. estimating μ with a precision of ε₀ when |μ|<ε₀.Consider a (2^(n+1)+1) state quantum mechanical system represented by(n+2) qubits with the following encoding for the states: S₀ S₁ . . .S_(N−1) (first two bits are 00, next n bits indicate the S_(α) state),R₀ R₁ . . . R_(N−1) (first two bits are 01, next n bits indicate theR_(α) state), and Q (first bit is a 1, the next (n+1) bits are zero).

The S_(α) states are the computational states, for each S_(α) statethere is an R_(α) state, also there is a single Q state. Each state isencoded by (n+2) qubits as shown above.

Associate the value x_(α) with each of the R_(α) and S_(α) states. Weneed the following 4 unitary operations in this algorithm (these aredenoted by M₁, M₂, R₁ and W₁.) It may be verified that these are indeedvalid unitary operations and, with the above encoding, they requireoperations on only a few qubits at a time.

M₁ If in state S₀: go to Q with an amplitude of 1/2, stay in S₀ with anamplitude of {square root over (3+L )}/2;

if in state Q: go to S₀ with an amplitude of 1/2, stay in Q with anamplitude of −{square root over (3+L )}/2;

if in any other state: stay in the same state.

M₂ If in state S₀: go to Q with an amplitude of 1/{square root over(2)}, stay in S₀ with an amplitude of 1/{square root over (2)};

if in state Q: go to S₀ with an amplitude of −1/{square root over (2)},stay in Q with an amplitude of 1/{square root over (2)};

if in any other state: stay in the same state.

R₁ If in state S_(α): go to R₆₀ with an amplitude of$\sqrt{\frac{2}{3} - {\frac{4}{3}x_{a}^{2}}},$

stay in S_(α) with an amplitude of$\left( {\frac{1}{\sqrt{3}} + \frac{2{ix}_{a}}{\sqrt{3}}} \right);$

if in state R_(α): got to S_(α) with an amplitude of$\sqrt{\frac{2}{3} - {\frac{4}{3}x_{a}^{2}}},$

stay in Rα with an amplitude$\left( {{- \frac{1}{\sqrt{3}}} + \frac{2{ix}_{a}}{\sqrt{3}}} \right);$

if in any other state: stay in the same state.

W₁ If in state S_(α): carry out the W-H transform on the S_(α) states;

if in any other state: stay in the same state.

It is easily shown that if we start with the S₀ state and carry out theoperation U, where U is defined as M₁W₁R₁W₁M₂, then the amplitude in theS₀ state will be $\frac{i\quad \mu}{\sqrt{2}}.$

As in the median estimation, (iv), U⁻¹ is the product of the inverses ofthe same matrices as U, but in the opposite order. By the aboveanalysis, it follows that: By $O\left( \frac{1}{ɛ_{0}} \right)$

repetitions of Q where Q≡−I_(S) ₀ U⁻¹I_(S) ₀ U, followed by a singleapplication of U, the amplitude in the S₀ state becomes$\frac{i\quad \mu}{\sqrt{2ɛ_{0}}}.$

Now if a measurement is made which projects the system onto one of itsbasis states, the probability of getting the S₀ state is$\frac{1}{2}{\left( \frac{\mu}{ɛ_{0}} \right)^{2}.}$

It can be shown by the central limit theorem that by repeating thisentire experiment ο(M) times, it is possible to estimate μ/ε₀ with aprecision of $\frac{1}{\sqrt{M}}.$

By an appropriate choice of M, it is possible to estimate μ within anerror bound of ε₀/2.

(vi) Enhancing General Quantum Mechanical Algorithms

The framework disclosed herein can be used to enhance the results of anyquantum mechanical algorithm. Assume there is a quantum mechanicalalgorithm Q due to which there is a finite amplitude Q_(ts) fortransitions from the starting state s to the target state t. Theprobability of being in the state t is hence |Q_(ts)|², and it wouldnormally take $\Omega \left( \frac{1}{{Q_{ts}}^{2}} \right)$

repetitions of Q to get a single observation of state t. Since thequantum mechanical algorithm Q is a sequence of η elementary unitaryoperations: Q₁Q₂. . . Q_(η), it is itself a unitary transformation.Also, Q⁻¹=Q_(η) ⁻¹Q_(η−1) ⁻¹ . . . Q₁ ⁻¹. The inverse of any elementaryunitary operation on a small number of qubits is another elementaryunitary operation on the same qubits and can hence be synthesized.Applying the abovedisclosed analysis, it follows that by starting withthe system in the s state and repeating$\Omega \left( \frac{1}{Q_{ts}} \right)$

times the sequence of operations −I_(s)Q⁻¹I_(t)Q followed by a singleapplication of Q, it is possible to reach the t-state with certainty.

I claim:
 1. An arrangement comprising: a data store capable ofcontaining one or more of 2^(n) states; a processor for transformingdata contained in said data store a preselected number of times with atransform Q having the form −I_(s)U⁻¹V⁻¹I_(t)VU, followed by atransforming of data contained in said data stores with a transformhaving the form VU, where U is a unitary transformation, V is a unitarytransformation, I_(s) is a diagonal matrix that characterizes a startingstate s of data stored in said data store, I_(t) is a diagonal matrixthat characterizes a terminating state t of data stored in said datastore, which corresponds to a desired solution, where either saidstarting state is any state other than the zero state, or said transformVU is any transform other than the Walsh Hadamard transform.
 2. Thearrangement of claim 1 where transformation U equals $\begin{bmatrix}\sqrt{1 - \frac{1}{\alpha}} & \frac{1}{\sqrt{\alpha}} \\\frac{1}{\sqrt{\alpha}} & {- \sqrt{1 - \frac{1}{\alpha}}}\end{bmatrix},{{where}\quad \alpha \quad {is}\quad a\quad {positive}\quad {real}\quad {number}\quad {greater}\quad {than}\quad 1.}$


3. The arrangement of claim 1 where α=2.
 4. The arrangement of claim 1where α=n/k and k is an integer less than n.
 5. The arrangement of claim1 where said selected number of times is on the order of 1/|U_(ts)|,where |U_(ts)| is the amplitude of reaching said terminating state tfrom said starting state s.
 6. The arrangement of claim 5 where saidselected number of times corresponds to an integer nearest to$\frac{\pi}{4{U_{ts}}}.$


7. The arrangement of claim 1 where I_(s) is a diagonal matrix with +1'salong the diagonal at all positions except along the diagonal in a rowthat corresponds to said starting state, where it is −1.
 8. Thearrangement of claim 1 where I_(t) is a diagonal matrix with +1's alongthe diagonal at all positions, except along the diagonal in a row thatcorresponds to said terminating state, where it is −1.
 9. Thearrangement of claim 1 where said transforms I_(s) and I_(t) performsselective rotation.
 10. The arrangement of claim 9 where said rotationseffect inversions.
 11. The arrangement of claim 1 where said data storeis a quantum mechanical system that is in a superposition of 2^(n)states, and said processor performs transformations on said amplitudesof said states.
 12. A method for moving a quantum mechanical physicalsystem which exists in a superposition of a plurality of states, from astarting state, to a terminating state, comprising the steps of:computing a measure |U_(ts)|², which corresponds to the probability ofsaid system reaching a desired target state t, when starting at a states, upon a single application of an operator U that is a unitary2^(n)×2^(n) matrix, where n is the number of qubits in said system;starting at said starting state, applying an operator Q≡−I_(s)U⁻¹I_(t)Ua number of times corresponding to η, which is an integer nearest to$\frac{\pi}{4{U_{ts}}},$

 where, I_(s) is a 2^(n)×2^(n) diagonal matrix and I_(t) is a2^(n)×2^(n) diagonal matrix; and  applying operator U to place saidsystem at a state where amplitude of said system at terminating state tis essentially equal to 1;  where said starting state is any state otherthan the zero state, or said opertor U is other than the Walsh Hadamardtransform.
 13. The method of claim 12 further comprising the step ofdetermining state of said quantum mechanical system after execution ofsaid step of applying operator U.
 14. The method of claim 12 where U isa 2^(n)×2^(n) matrix of elements, constructed from n repeatedapplications of a 2×2 matrix containing a $\sqrt{1 - \frac{1}{\alpha}}$

term and a $- \sqrt{1 - \frac{1}{\alpha}}$

on the diagonal, $\frac{1}{\sqrt{\alpha}}$

terms on other than the diagonal.
 15. The method of claim 12 where α=2.16. The method of claim 12 where α=n/k and k is an integer less than n.17. The method of claim 12 where U=WRW, where W is a Walsh-Hadamardtransform, and R is a diagonal selective inversion matrix.
 18. Themethod of claim 12 where U=WRW, where W is a matrix comprising elements$\frac{\pm 1}{2^{n/2}}$

with columns that are orthogonal to each other, and R is a diagonalselective inversion matrix.